<?php

class m130808_142635_create_table_clients extends CDbMigration
{
	public function up()
	{
		$this->createTable('{{clients}}',array(
			'id' => 'pk',
			'surname' => 'VARCHAR(250) NOT NULL',
			'name' => 'VARCHAR(250) NOT NULL',
			'patronymic' => 'VARCHAR(250) NOT NULL',
			'dob' => 'DATE NOT NULL',
			'phone' => 'VARCHAR(30) NULL DEFAULT NULL',
			'email' => 'VARCHAR(100) NULL DEFAULT NULL',
			'created_at' => 'DATETIME NOT NULL',
			'updated_at' => 'TIMESTAMP NOT NULL',
			'active' => 'INT(1) NOT NULL DEFAULT 1'
		));
	}

	public function down()
	{
		$this->dropTable('{{clients}}');
	}
}